import { request } from '@/utils/request.js'

export async function login(params){//登录
	return await request(`user/login/${params.code}`,'POST',params)
}
export async function wxBindPhone(params){//微信绑定手机号
	return await request('user/wxBindPhone','POST',params)
}
export async function appLoginCaptchaImage(params){//app登录图形验证码
	return await request('user/appLoginCaptchaImage','GET',params,{},'arraybuffer')
}
export async function sendPhoneCode(params){//发送短信验证码
	return await request('user/sendPhoneCode','GET',params)
}
export async function loginByPhone(params){//手机号登录
	return await request('user/loginByPhone','GET',params)
}
export async function closeAccount(params){//注销
	return await request('user/closeAccount','POST',params)
}


export async function banner(params){//banner列表
	return await request('index/banner','GET',params)
}
export async function getKeMu(params){//获取科目
	return await request('index/getKeMu','GET',params)
}
export async function getDeptByKeMu(params){//获取科目下的所有三级分类
	return await request('index/getDeptByKeMu','GET',params)
}
export async function getSubjectByDept(params){//获取分类下的所有题目
	return await request('index/getSubjectByDept','GET',params)
}
export async function indexData(params){//首页数据
	return await request('index/indexData','GET',params)
}
export async function indexDataNotLogin(params){//首页数据-未登录
	return await request('index/indexDataNotLogin','GET',params)
}
export async function addSingleHistory(params){//添加单个做题历史记录
	return await request('index/addSingleHistory','POST',params)
}
export async function addHistory(params){//添加做题历史记录
	return await request('index/addHistory','POST',params)
}
export async function getHistory(params){//查询刷题记录列表
	return await request('index/getHistory','GET',params)
}
export async function getHistorySubjects(params){//查询刷题记录题目
	return await request('index/getHistorySubjects','GET',params)
}
export async function getSubjectById(params){//根据id查题
	return await request('index/getSubjectById','GET',params)
}

export async function exams(params){//考试通知列表
	return await request('/escort/api/index/exams','GET',params,{oldApi: true})
}
export async function getCourseSubjectByCateNotLogin (params){//获取课程章节下面的课件
	return await request('/escort/api/index/getCourseSubjectByCateNotLogin','GET',params,{oldApi: true})
}
export async function getConfigById (params){//获取考试流程菜单推文信息
	return await request(`/escort/api/index/getConfigById?id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22`,'GET',params,{oldApi: true})
}
export async function courseListV3(params){//课程列表
	return await request('/escort/api/index/courseListV3','POST',params,{oldApi: true})
}
export async function getCourseSubjectByCate (params){//获取课程章节下面的课件
	return await request('/escort/api/index/getCourseSubjectByCate','GET',params,{oldApi: true})
}
export async function courseDetail(params){//课程详情
	return await request('/escort/api/index/courseDetail','GET',params,{oldApi: true})
}

export async function practiceReport(params){//刷题报告
	return await request('practice/practiceReport','GET',params)
}
export async function errorReplay(params){//错题攻克
	return await request('practice/errorReplay','GET',params)
}
export async function chapterFortify(params){//章节强化
	return await request('practice/chapterFortify','GET',params)
}
export async function todayEnhance(params){//每日提升
	return await request('practice/todayEnhance','GET',params)
}
export async function mockExam(params){//万人模考
	return await request('practice/mockExam','GET',params)
}
export async function saveAiAnalyze(params){//保存Ai分析
	return await request('practice/saveAiAnalyze','POST',params)
}
export async function getSubjectCollectAndComment(params){//查询收藏和笔记状态
	return await request('practice/getSubjectCollectAndComment','GET',params)
}
export async function getPracticeInfoByChar(params){//获取章，节的做题统计数据
	return await request('practice/getPracticeInfoByChar','GET',params)
}
export async function getErrorAndCollectInfoByChar(params){//获取章、节的错题收藏统计信息（错题，收藏分类时）
	return await request('practice/getErrorAndCollectInfoByChar','GET',params)
}
export async function getMockRateByScore(params){//根据分数查超过的百分比
	return await request('practice/getMockRateByScore','GET',params)
}
export async function getAiAnalyzeByPid(params){//获取AI分析
	return await request('practice/getAiAnalyzeByPid','GET',params)
}
export async function getAiAnalyzeById(params){//查询AI分析的笔记
	return await request('practice/getAiAnalyzeById','GET',params)
}

export async function commentsBySubject(params){//查询题目的评论
	return await request('comment/commentsBySubject','GET',params)
}
export async function addComment(params){//添加评论、笔记
	return await request('comment/addComment','POST',params)
}
export async function agreeComment(params){//点赞/反对评论，笔记
	return await request('comment/agreeComment','GET',params,{showLoading: false})
}
export async function selectComments(params){//我的评论，笔记
	return await request('comment/selectComments','GET',params)
}
export async function deleteComment(params){//删除评论，笔记
	return await request('comment/deleteComment','GET',params)
}

export async function addCollect(params){//添加收藏
	return await request('collect/addCollect','GET',params)
}
export async function deleteCollect(params){//删除收藏
	return await request('collect/deleteCollect','GET',params)
}
export async function selectCollect(params){//查询收藏、错题
	return await request('collect/selectCollect','GET',params)
}
